package com.keeson.android_cli.util;


import com.keeson.android_cli.App;

public class DPUtils {
    public static int px2dip(float pxValue) {
        float scale = App.getApp().getResources().getDisplayMetrics().density;
        return (int) (pxValue / scale + 0.5f);
    }

    public static int dip2px(float dpValue) {
        float scale = App.getApp().getResources().getDisplayMetrics().density;
        return (int) (dpValue * scale + 0.5f);
    }
}
